﻿
namespace slfj.Web
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.EntityFramework;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;


    // Implements application logic using the TIMVIECDBEntities context.
    // TODO: Add your application logic to these methods or in additional methods.
    // TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
    // Also consider adding roles to restrict access as appropriate.
    // [RequiresAuthentication]
    [EnableClientAccess()]
    public class DomainDB : LinqToEntitiesDomainService<TIMVIECDBEntities>
    {

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CVTIMVIECs' query.
        public IQueryable<CVTIMVIEC> GetCVTIMVIECs()
        {
            return this.ObjectContext.CVTIMVIECs;
        }

        public void InsertCVTIMVIEC(CVTIMVIEC cVTIMVIEC)
        {
            if ((cVTIMVIEC.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cVTIMVIEC, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CVTIMVIECs.AddObject(cVTIMVIEC);
            }
        }

        public void UpdateCVTIMVIEC(CVTIMVIEC currentCVTIMVIEC)
        {
            this.ObjectContext.CVTIMVIECs.AttachAsModified(currentCVTIMVIEC, this.ChangeSet.GetOriginal(currentCVTIMVIEC));
        }

        public void DeleteCVTIMVIEC(CVTIMVIEC cVTIMVIEC)
        {
            if ((cVTIMVIEC.EntityState == EntityState.Detached))
            {
                this.ObjectContext.CVTIMVIECs.Attach(cVTIMVIEC);
            }
            this.ObjectContext.CVTIMVIECs.DeleteObject(cVTIMVIEC);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CVUNGTUYENs' query.
        public IQueryable<CVUNGTUYEN> GetCVUNGTUYENs()
        {
            return this.ObjectContext.CVUNGTUYENs;
        }

        public void InsertCVUNGTUYEN(CVUNGTUYEN cVUNGTUYEN)
        {
            if ((cVUNGTUYEN.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cVUNGTUYEN, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CVUNGTUYENs.AddObject(cVUNGTUYEN);
            }
        }

        public void UpdateCVUNGTUYEN(CVUNGTUYEN currentCVUNGTUYEN)
        {
            this.ObjectContext.CVUNGTUYENs.AttachAsModified(currentCVUNGTUYEN, this.ChangeSet.GetOriginal(currentCVUNGTUYEN));
        }

        public void DeleteCVUNGTUYEN(CVUNGTUYEN cVUNGTUYEN)
        {
            if ((cVUNGTUYEN.EntityState == EntityState.Detached))
            {
                this.ObjectContext.CVUNGTUYENs.Attach(cVUNGTUYEN);
            }
            this.ObjectContext.CVUNGTUYENs.DeleteObject(cVUNGTUYEN);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'LOAICONGVIECs' query.
        public IQueryable<LOAICONGVIEC> GetLOAICONGVIECs()
        {
            return this.ObjectContext.LOAICONGVIECs;
        }

        public void InsertLOAICONGVIEC(LOAICONGVIEC lOAICONGVIEC)
        {
            if ((lOAICONGVIEC.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(lOAICONGVIEC, EntityState.Added);
            }
            else
            {
                this.ObjectContext.LOAICONGVIECs.AddObject(lOAICONGVIEC);
            }
        }

        public void UpdateLOAICONGVIEC(LOAICONGVIEC currentLOAICONGVIEC)
        {
            this.ObjectContext.LOAICONGVIECs.AttachAsModified(currentLOAICONGVIEC, this.ChangeSet.GetOriginal(currentLOAICONGVIEC));
        }

        public void DeleteLOAICONGVIEC(LOAICONGVIEC lOAICONGVIEC)
        {
            if ((lOAICONGVIEC.EntityState == EntityState.Detached))
            {
                this.ObjectContext.LOAICONGVIECs.Attach(lOAICONGVIEC);
            }
            this.ObjectContext.LOAICONGVIECs.DeleteObject(lOAICONGVIEC);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'LOAINHATUYENDUNGs' query.
        public IQueryable<LOAINHATUYENDUNG> GetLOAINHATUYENDUNGs()
        {
            return this.ObjectContext.LOAINHATUYENDUNGs;
        }

        public void InsertLOAINHATUYENDUNG(LOAINHATUYENDUNG lOAINHATUYENDUNG)
        {
            if ((lOAINHATUYENDUNG.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(lOAINHATUYENDUNG, EntityState.Added);
            }
            else
            {
                this.ObjectContext.LOAINHATUYENDUNGs.AddObject(lOAINHATUYENDUNG);
            }
        }

        public void UpdateLOAINHATUYENDUNG(LOAINHATUYENDUNG currentLOAINHATUYENDUNG)
        {
            this.ObjectContext.LOAINHATUYENDUNGs.AttachAsModified(currentLOAINHATUYENDUNG, this.ChangeSet.GetOriginal(currentLOAINHATUYENDUNG));
        }

        public void DeleteLOAINHATUYENDUNG(LOAINHATUYENDUNG lOAINHATUYENDUNG)
        {
            if ((lOAINHATUYENDUNG.EntityState == EntityState.Detached))
            {
                this.ObjectContext.LOAINHATUYENDUNGs.Attach(lOAINHATUYENDUNG);
            }
            this.ObjectContext.LOAINHATUYENDUNGs.DeleteObject(lOAINHATUYENDUNG);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'LOAITAIKHOANs' query.
        public IQueryable<LOAITAIKHOAN> GetLOAITAIKHOANs()
        {
            return this.ObjectContext.LOAITAIKHOANs;
        }

        public void InsertLOAITAIKHOAN(LOAITAIKHOAN lOAITAIKHOAN)
        {
            if ((lOAITAIKHOAN.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(lOAITAIKHOAN, EntityState.Added);
            }
            else
            {
                this.ObjectContext.LOAITAIKHOANs.AddObject(lOAITAIKHOAN);
            }
        }

        public void UpdateLOAITAIKHOAN(LOAITAIKHOAN currentLOAITAIKHOAN)
        {
            this.ObjectContext.LOAITAIKHOANs.AttachAsModified(currentLOAITAIKHOAN, this.ChangeSet.GetOriginal(currentLOAITAIKHOAN));
        }

        public void DeleteLOAITAIKHOAN(LOAITAIKHOAN lOAITAIKHOAN)
        {
            if ((lOAITAIKHOAN.EntityState == EntityState.Detached))
            {
                this.ObjectContext.LOAITAIKHOANs.Attach(lOAITAIKHOAN);
            }
            this.ObjectContext.LOAITAIKHOANs.DeleteObject(lOAITAIKHOAN);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'NGANHNGHEs' query.
        public IQueryable<NGANHNGHE> GetNGANHNGHEs()
        {
            return this.ObjectContext.NGANHNGHEs;
        }

        public void InsertNGANHNGHE(NGANHNGHE nGANHNGHE)
        {
            if ((nGANHNGHE.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(nGANHNGHE, EntityState.Added);
            }
            else
            {
                this.ObjectContext.NGANHNGHEs.AddObject(nGANHNGHE);
            }
        }

        public void UpdateNGANHNGHE(NGANHNGHE currentNGANHNGHE)
        {
            this.ObjectContext.NGANHNGHEs.AttachAsModified(currentNGANHNGHE, this.ChangeSet.GetOriginal(currentNGANHNGHE));
        }

        public void DeleteNGANHNGHE(NGANHNGHE nGANHNGHE)
        {
            if ((nGANHNGHE.EntityState == EntityState.Detached))
            {
                this.ObjectContext.NGANHNGHEs.Attach(nGANHNGHE);
            }
            this.ObjectContext.NGANHNGHEs.DeleteObject(nGANHNGHE);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'NGUOITIMVIECs' query.
        public IQueryable<NGUOITIMVIEC> GetNGUOITIMVIECs()
        {
            return this.ObjectContext.NGUOITIMVIECs;
        }

        public void InsertNGUOITIMVIEC(NGUOITIMVIEC nGUOITIMVIEC)
        {
            if ((nGUOITIMVIEC.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(nGUOITIMVIEC, EntityState.Added);
            }
            else
            {
                this.ObjectContext.NGUOITIMVIECs.AddObject(nGUOITIMVIEC);
            }
        }

        public void UpdateNGUOITIMVIEC(NGUOITIMVIEC currentNGUOITIMVIEC)
        {
            this.ObjectContext.NGUOITIMVIECs.AttachAsModified(currentNGUOITIMVIEC, this.ChangeSet.GetOriginal(currentNGUOITIMVIEC));
        }

        public void DeleteNGUOITIMVIEC(NGUOITIMVIEC nGUOITIMVIEC)
        {
            if ((nGUOITIMVIEC.EntityState == EntityState.Detached))
            {
                this.ObjectContext.NGUOITIMVIECs.Attach(nGUOITIMVIEC);
            }
            this.ObjectContext.NGUOITIMVIECs.DeleteObject(nGUOITIMVIEC);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'NHATUYENDUNGs' query.
        public IQueryable<NHATUYENDUNG> GetNHATUYENDUNGs()
        {
            return this.ObjectContext.NHATUYENDUNGs;
        }

        public void InsertNHATUYENDUNG(NHATUYENDUNG nHATUYENDUNG)
        {
            if ((nHATUYENDUNG.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(nHATUYENDUNG, EntityState.Added);
            }
            else
            {
                this.ObjectContext.NHATUYENDUNGs.AddObject(nHATUYENDUNG);
            }
        }

        public void UpdateNHATUYENDUNG(NHATUYENDUNG currentNHATUYENDUNG)
        {
            this.ObjectContext.NHATUYENDUNGs.AttachAsModified(currentNHATUYENDUNG, this.ChangeSet.GetOriginal(currentNHATUYENDUNG));
        }

        public void DeleteNHATUYENDUNG(NHATUYENDUNG nHATUYENDUNG)
        {
            if ((nHATUYENDUNG.EntityState == EntityState.Detached))
            {
                this.ObjectContext.NHATUYENDUNGs.Attach(nHATUYENDUNG);
            }
            this.ObjectContext.NHATUYENDUNGs.DeleteObject(nHATUYENDUNG);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'QUOCGIAs' query.
        public IQueryable<QUOCGIA> GetQUOCGIAs()
        {
            return this.ObjectContext.QUOCGIAs;
        }

        public void InsertQUOCGIA(QUOCGIA qUOCGIA)
        {
            if ((qUOCGIA.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(qUOCGIA, EntityState.Added);
            }
            else
            {
                this.ObjectContext.QUOCGIAs.AddObject(qUOCGIA);
            }
        }

        public void UpdateQUOCGIA(QUOCGIA currentQUOCGIA)
        {
            this.ObjectContext.QUOCGIAs.AttachAsModified(currentQUOCGIA, this.ChangeSet.GetOriginal(currentQUOCGIA));
        }

        public void DeleteQUOCGIA(QUOCGIA qUOCGIA)
        {
            if ((qUOCGIA.EntityState == EntityState.Detached))
            {
                this.ObjectContext.QUOCGIAs.Attach(qUOCGIA);
            }
            this.ObjectContext.QUOCGIAs.DeleteObject(qUOCGIA);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'sysdiagrams' query.
        public IQueryable<sysdiagram> GetSysdiagrams()
        {
            return this.ObjectContext.sysdiagrams;
        }

        public void InsertSysdiagram(sysdiagram sysdiagram)
        {
            if ((sysdiagram.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sysdiagram, EntityState.Added);
            }
            else
            {
                this.ObjectContext.sysdiagrams.AddObject(sysdiagram);
            }
        }

        public void UpdateSysdiagram(sysdiagram currentsysdiagram)
        {
            this.ObjectContext.sysdiagrams.AttachAsModified(currentsysdiagram, this.ChangeSet.GetOriginal(currentsysdiagram));
        }

        public void DeleteSysdiagram(sysdiagram sysdiagram)
        {
            if ((sysdiagram.EntityState == EntityState.Detached))
            {
                this.ObjectContext.sysdiagrams.Attach(sysdiagram);
            }
            this.ObjectContext.sysdiagrams.DeleteObject(sysdiagram);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TAIKHOANs' query.
        public IQueryable<TAIKHOAN> GetTAIKHOANs()
        {
            return this.ObjectContext.TAIKHOANs;
        }

        public void InsertTAIKHOAN(TAIKHOAN tAIKHOAN)
        {
            if ((tAIKHOAN.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tAIKHOAN, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TAIKHOANs.AddObject(tAIKHOAN);
            }
        }

        public void UpdateTAIKHOAN(TAIKHOAN currentTAIKHOAN)
        {
            this.ObjectContext.TAIKHOANs.AttachAsModified(currentTAIKHOAN, this.ChangeSet.GetOriginal(currentTAIKHOAN));
        }

        public void DeleteTAIKHOAN(TAIKHOAN tAIKHOAN)
        {
            if ((tAIKHOAN.EntityState == EntityState.Detached))
            {
                this.ObjectContext.TAIKHOANs.Attach(tAIKHOAN);
            }
            this.ObjectContext.TAIKHOANs.DeleteObject(tAIKHOAN);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'THAMSOes' query.
        public IQueryable<THAMSO> GetTHAMSOes()
        {
            return this.ObjectContext.THAMSOes;
        }

        public void InsertTHAMSO(THAMSO tHAMSO)
        {
            if ((tHAMSO.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tHAMSO, EntityState.Added);
            }
            else
            {
                this.ObjectContext.THAMSOes.AddObject(tHAMSO);
            }
        }

        public void UpdateTHAMSO(THAMSO currentTHAMSO)
        {
            this.ObjectContext.THAMSOes.AttachAsModified(currentTHAMSO, this.ChangeSet.GetOriginal(currentTHAMSO));
        }

        public void DeleteTHAMSO(THAMSO tHAMSO)
        {
            if ((tHAMSO.EntityState == EntityState.Detached))
            {
                this.ObjectContext.THAMSOes.Attach(tHAMSO);
            }
            this.ObjectContext.THAMSOes.DeleteObject(tHAMSO);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'THANHPHOes' query.
        public IQueryable<THANHPHO> GetTHANHPHOes()
        {
            return this.ObjectContext.THANHPHOes;
        }

        public void InsertTHANHPHO(THANHPHO tHANHPHO)
        {
            if ((tHANHPHO.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tHANHPHO, EntityState.Added);
            }
            else
            {
                this.ObjectContext.THANHPHOes.AddObject(tHANHPHO);
            }
        }

        public void UpdateTHANHPHO(THANHPHO currentTHANHPHO)
        {
            this.ObjectContext.THANHPHOes.AttachAsModified(currentTHANHPHO, this.ChangeSet.GetOriginal(currentTHANHPHO));
        }

        public void DeleteTHANHPHO(THANHPHO tHANHPHO)
        {
            if ((tHANHPHO.EntityState == EntityState.Detached))
            {
                this.ObjectContext.THANHPHOes.Attach(tHANHPHO);
            }
            this.ObjectContext.THANHPHOes.DeleteObject(tHANHPHO);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'THONGTINTUYENDUNGs' query.
        public IQueryable<THONGTINTUYENDUNG> GetTHONGTINTUYENDUNGs()
        {
            return this.ObjectContext.THONGTINTUYENDUNGs;
        }

        public void InsertTHONGTINTUYENDUNG(THONGTINTUYENDUNG tHONGTINTUYENDUNG)
        {
            if ((tHONGTINTUYENDUNG.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tHONGTINTUYENDUNG, EntityState.Added);
            }
            else
            {
                this.ObjectContext.THONGTINTUYENDUNGs.AddObject(tHONGTINTUYENDUNG);
            }
        }

        public void UpdateTHONGTINTUYENDUNG(THONGTINTUYENDUNG currentTHONGTINTUYENDUNG)
        {
            this.ObjectContext.THONGTINTUYENDUNGs.AttachAsModified(currentTHONGTINTUYENDUNG, this.ChangeSet.GetOriginal(currentTHONGTINTUYENDUNG));
        }

        public void DeleteTHONGTINTUYENDUNG(THONGTINTUYENDUNG tHONGTINTUYENDUNG)
        {
            if ((tHONGTINTUYENDUNG.EntityState == EntityState.Detached))
            {
                this.ObjectContext.THONGTINTUYENDUNGs.Attach(tHONGTINTUYENDUNG);
            }
            this.ObjectContext.THONGTINTUYENDUNGs.DeleteObject(tHONGTINTUYENDUNG);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TINNHANs' query.
        public IQueryable<TINNHAN> GetTINNHANs()
        {
            return this.ObjectContext.TINNHANs;
        }

        public void InsertTINNHAN(TINNHAN tINNHAN)
        {
            if ((tINNHAN.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tINNHAN, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TINNHANs.AddObject(tINNHAN);
            }
        }

        public void UpdateTINNHAN(TINNHAN currentTINNHAN)
        {
            this.ObjectContext.TINNHANs.AttachAsModified(currentTINNHAN, this.ChangeSet.GetOriginal(currentTINNHAN));
        }

        public void DeleteTINNHAN(TINNHAN tINNHAN)
        {
            if ((tINNHAN.EntityState == EntityState.Detached))
            {
                this.ObjectContext.TINNHANs.Attach(tINNHAN);
            }
            this.ObjectContext.TINNHANs.DeleteObject(tINNHAN);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TRINHDOes' query.
        public IQueryable<TRINHDO> GetTRINHDOes()
        {
            return this.ObjectContext.TRINHDOes;
        }

        public void InsertTRINHDO(TRINHDO tRINHDO)
        {
            if ((tRINHDO.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tRINHDO, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TRINHDOes.AddObject(tRINHDO);
            }
        }

        public void UpdateTRINHDO(TRINHDO currentTRINHDO)
        {
            this.ObjectContext.TRINHDOes.AttachAsModified(currentTRINHDO, this.ChangeSet.GetOriginal(currentTRINHDO));
        }

        public void DeleteTRINHDO(TRINHDO tRINHDO)
        {
            if ((tRINHDO.EntityState == EntityState.Detached))
            {
                this.ObjectContext.TRINHDOes.Attach(tRINHDO);
            }
            this.ObjectContext.TRINHDOes.DeleteObject(tRINHDO);
        }
    }
}


